package mjc.egg;
import mjc.tds.*;
import mjc.type.*;
import mjc.gc.*;
import mjc.compiler.*;
import java.util.*;
import mg.egg.eggc.compiler.libjava.lex.*;
import mg.egg.eggc.compiler.libjava.*;
import mg.egg.eggc.compiler.libjava.problem.IProblem;
import java.util.Vector;
import java.util.List;
import java.util.ArrayList;
public class S_T_MJAVA implements IDstNode {
LEX_MJAVA scanner;
  S_T_MJAVA() {
    }
  S_T_MJAVA(LEX_MJAVA scanner) {
    this.scanner = scanner;
    offset = 0;
    length = 0;
    this.att_scanner = scanner;
    }
int [] sync= new int[0];
  String att_code;
  VAR att_var;
  DTYPE att_type;
  TDS att_tds;
  TAM att_cpu;
  LEX_MJAVA att_scanner;
  LinkedList<TDS> att_tdsi;
  private void regle54() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    S_F_MJAVA x_2 = new S_F_MJAVA(scanner) ;
    S_TX_MJAVA x_3 = new S_TX_MJAVA(scanner) ;
    //appel
      action_auto_inh_54(x_2, x_3);
    x_2.analyser() ;
      addChild(x_2);
    x_3.analyser() ;
      addChild(x_3);
      action_code29_54(x_2, x_3);
     length =x_3.getOffset() + x_3.getLength()  -offset;
  }
private void action_code29_54(S_F_MJAVA x_2, S_TX_MJAVA x_3) throws Exception {
try {
// locales
// instructions
this.att_var=x_2.att_var;
if (x_2.att_type.compareTo(x_3.att_type)){
this.att_type=x_2.att_type;
}
else {
att_scanner._interrompre(IProblem.Semantic, att_scanner.getBeginLine(), IMJAVAMessages.id_T_05, MJAVAMessages.T_05,new Object[]{""+x_2.att_type.getNom(), ""+x_3.att_type.getNom()});

}
this.att_code=x_2.att_code+x_3.att_code;
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_auto_inh_54(S_F_MJAVA x_2, S_TX_MJAVA x_3) throws Exception {
try {
// instructions
x_2.att_tds=this.att_tds;
x_3.att_tds=this.att_tds;
x_2.att_tdsi=this.att_tdsi;
x_3.att_tdsi=this.att_tdsi;
x_2.att_cpu=this.att_cpu;
x_3.att_cpu=this.att_cpu;
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
  public void analyser () throws Exception {
    regle54 () ;
  }
    private IDstNode parent;
    public void setParent( IDstNode p){parent = p;}
    public IDstNode getParent(){return parent;}
    private List<IDstNode> children = null ;
    public void addChild(IDstNode node){
      if (children == null) {
         children = new ArrayList<IDstNode>() ;}
      children.add(node);
      node.setParent(this);
    }
    public List<IDstNode> getChildren(){return children;}
    public boolean isLeaf(){return children == null;}
    public void accept(IDstVisitor visitor) {
      boolean visitChildren = visitor.visit(this);
      if (visitChildren && children != null){
        for(IDstNode node : children){
          node.accept(visitor);
        }
    }
    visitor.endVisit(this);
  }
  private int offset;
  private int length;
  public int getOffset(){return offset;}
  public void setOffset(int o){offset = o;}
  public int getLength(){return length;}
  public void setLength(int l){length = l;}
  private boolean malformed = false;
  public void setMalformed(){malformed = true;}
  public boolean isMalformed(){return malformed;}
  }
